open Polynome
open Ikah
open Printf


let _ =

print_endline (string_of_int (power 5 2));
print_endline (string_of_int (application [(2,2);(2,3);(4,4)] 2));

print_endline "";

List.iter (fun (x,y) -> print_endline ("("^(string_of_int x)^", "^(string_of_int y)^");")) 
(Polynome.add [(1,2);(2,6);(7,8);(2,12)] [(1,4);(3,6);(1,9)]);

print_endline "";

List.iter (fun (x,y) -> print_endline ("("^(string_of_int x)^", "^(string_of_int y)^");"))
(soustract [(1,2);(2,6);(7,8);(2,12)] [(1,4);(3,6);(1,9)]);

print_endline "";

List.iter (fun (x,y) -> print_endline ("("^(string_of_int x)^", "^(string_of_int y)^");"))
(deriv [(2,2);(2,3);(4,4)]);

let l42 =  [("Don", 435.);("Nut",75.);("Toto",42.)] in

print_endline (string_of_float (find "Toto" [("Don", 435.);("Nut",75.);("Toto",42.)]));

print_endline "";

List.iter (fun (x,y) -> print_endline ("("^(x)^", "^(string_of_float y)^");"))
(Ikah.add ("ToT", 4352.) l42);

print_endline "";

List.iter (fun (x,y) -> print_endline ("("^(x)^", "^(string_of_float y)^");"))
(delete "Nut" l42);

print_endline "";

List.iter (fun (x,y) -> print_endline ("("^(x)^", "^(string_of_float y)^");"))
(update "Toto" 45. l42);

print_endline "";

List.iter (fun (x,y) -> print_endline ("("^(x)^", "^(string_of_float y)^");"))
(sales l42 10.);

print_endline "";

List.iter (fun (x,y) -> print_endline ("("^(x)^", "^(string_of_float y)^");"))
(fusion l42 [("Don", 674.23);("Fillipo", 674.23);("Tototo", 674.23)])

